package com.example.qjia.util.retrofit;

import com.example.qjia.data.HolidayMessage;
import com.example.qjia.data.romotedata.AbsenceSlip;

import com.example.qjia.data.romotedata.Result;
import com.example.qjia.data.romotedata.Student;
import com.example.qjia.data.romotedata.person;
import com.example.qjia.data.romotedata.ResponseData;

import java.util.List;
import java.util.Map;

import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by ying_xiang on 2016/8/17.
 */
public interface QjiaService {

    @FormUrlEncoded
    @POST("slip/addAbsenceSlip")
    Observable<ResponseData> addAbsenceSlip(@FieldMap Map<String,String>params);/*@Field("startTime")String timestart,@Field("endTime")String timeEnd,@Field("applyTime")String timeApply,@Field("reason")String reason,@Field("sid")int sid,@Field("tid")int tid);//添加假条*/



    @POST("slip/getAll")
    Observable<ResponseData<List<AbsenceSlip>>> getAllAbsenseSlip(@Field("uerId")int StudentId);//获取学生所有假条

    @FormUrlEncoded             //注册信息
    @POST("student/register")
    Observable<Result> registerStudent(@Field("name")String name,@Field("studentId")String studentId,@Field("password")String password,@Field("email")String email ,@Field("phone")String phone,@Field("academy")String academy,@Field("major")String major,@Field("mclass")String mclass);

    @FormUrlEncoded
    @POST("student/login")
    Observable<ResponseData<Student>> login(@Field("studentId")String studentId,@Field("password")String pwd);

    @GET("student/getStudent")
    Observable<ResponseData<Student>> getStudent(@Query("id") String sid);

    @FormUrlEncoded
    @POST("student/updateInfo")
    Observable<ResponseData> UpdateStudentInfo(@FieldMap Map<String,String>params);
    //Observable<ResponseData> UpdateStudentInfo(@Field("email")String mail);


    @GET("slip/getAbsenceSlips")
    Observable<ResponseData<List<AbsenceSlip>>> getAbsenseByPage(@QueryMap Map<String,String>params);

    @GET("slip/getAbsenceSlip")
    Observable<ResponseData<AbsenceSlip>>getAbsenseSlipById(@Query("id")String aid);//通过假条id来获取假条的详细信息


}
